file = None
try:
    file = open("test.txt","r")
    content = file.read()
    print(content)
except FileNotFoundError:
    print("文件不存在") 
finally:
    if file is not None:
        file.close()
